# 课后作战第一步
import os
import cv2
#获取demo.py的绝对路径
script_dir = os.path.dirname(os.path.abspath(__file__))
# 构建正确的图片路径
img_path = os.path.normpath(os.path.join(script_dir, "data/cardboard/cardboard1.jpg"))
img = cv2.imread(img_path)
cv2.imshow("Successful!",img)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite("gray.jpg", gray)
cv2.imshow("Successfully!",gray)
print("首杀成就达成！")
cv2.waitKey(0)
